home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5073 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: ns2.emirates.net.ae!usenet
  2. From: kannan@emirates.net.ae (Kannan)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Finding a prime number
  5. Date: Sun, 11 Feb 1996 15:43:37 GMT
  6. Organization: ETISALAT Emirates Internet
  7. Message-ID: <4fl2tl$ln6@ns2.emirates.net.ae>
  8. References: <4e875s$nqk@reader2.ix.netcom.com> <7c8_9601301722@tor250.org> <4f7n1o$ol9@mother.usf.edu>
  9. NNTP-Posting-Host: csb006.emirates.net.ae
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. yatesc@csee.usf.edu (Randy Yates) wrote:
  13.  
  14. >In article <7c8_9601301722@tor250.org>, Andrew.Frank@fknights.gryn.org says...
  15. >>
  16. >>As advtr@ix.netcom.com had made knowen to All, on 25 Jan 96  10:21:32, I
  17. >>quote.
  18. >> ad> I need to write a function that will find wether or not a number is
  19. >> ad> prime.  I can come close but I get numbers that are not prime with the
  20. >> ad> prime numbers.
  21.  
  22. >#include<math.h>
  23. >#include<stdlib.h>
  24. >#include<fstream.h>
  25.  
  26. Is it not easy to just check whether the integer is divisible by 2 or
  27. 3 and decide (except 1 & 3 which is a prime number)? For ex., 723232
  28. this would be divisible by 2 so not a prime number. And 997 cannot be
  29. divided by these 2. This is prime number. Please correct me if I am
  30. wrong without attacking me personally :)
  31.  
  32. Kannan from Dubai.
  33. P O Box 16765
  34. Dubai
  35. United Arab Emirates
  36.  
  37. Ph : 971 4 835551
  38. Fax : 971 4 835304
  39.  
  40. Email : kannan@emirates.net.ae (internet)
  41.     kn kannan@dmc (majornet)
  42.  
  43.